﻿@model KRM.Core.RoleModel
@{
    ViewBag.Title = "Edit " + Model.Name;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="container-fluid">
    <div class="page-header">
    </div>
    <div class="row-fluid">
        <div class="span12">
            <div class="box">
                <div class="box-title">
                    <h3><i class="icon-edit"></i> Edit @Model.Name</h3>
                </div>
                <div class="box-content">
                    @if (!string.IsNullOrEmpty(ViewBag.msg) && ViewBag.msg == "success")
                    {
                        <div class="alert alert-success">
                            <button type="button" class="close" data-dismiss="alert">×</button>
                            <strong>Success.</strong> Update success!
                        </div>
                    }
                    @using (Html.BeginForm("EditRole", "Permission", FormMethod.Post, new { @class = "form-horizontal" }))
                    {
                        <div class="control-group">
                            <label class="control-label" for="Name">Name</label>
                            <div class="controls">
                                @Html.EditorFor(model => model.Name, new { required = "required" })
                                @Html.ValidationMessageFor(model => model.Name)
                            </div>
                        </div>
                        <div class="form-actions">
                            <button type="submit" class="btn btn-primary">Update</button>
                            <input type="button" class="btn" onclick="javascript: window.location = '/permission/role';" value="Cancel">
                        </div>
                    }
                </div>
            </div>
        </div>
    </div>
</div>
